#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <po_hi_messages.h>

int main (int argc, char*argv[])
{
  int var1;
  int var2;
  __po_hi_msg_t message;

  var1 = 2;
  __po_hi_msg_reallocate (&message);
  printf ("var1=%d\n", var1);
  printf ("Avant le write, taille message=%d\n", __po_hi_msg_length( &message));
  __po_hi_msg_write (&message, &var1, sizeof (int));
  printf ("Apres le write, taille message=%d\n", __po_hi_msg_length( &message));
  __po_hi_msg_read (&message, &var2, sizeof (int));
  printf ("Apres le read, taille message=%d\n", __po_hi_msg_length( &message));
  printf ("var2=%d\n", var2);
  exit (0);
}
